package com.yuandian.enums;

/**
 * 下载文件类型和对应的下载类的映射
 */
public enum DocumentHandlerType {

	BUSINESS_STEP_EXCEL_HANDLER(1, "businessStepExcelHandler"),

	BASE_ALARM_EXCEL_HANDLE(2, "baseAlarmExcelHandler"),

	BUSINESS_DETAIL_EXCEL_HANDLER(3, "businessDetailExcelHandler");

	private Integer documentCode;

	private String handleMethod;

	DocumentHandlerType(Integer documentCode, String handleMethod) {
		this.documentCode = documentCode;
		this.handleMethod = handleMethod;
	}

	public static String getDocumentHandlerEnumValue(Integer key){
		for (DocumentHandlerType moduleEnum : DocumentHandlerType.values()) {
			if(moduleEnum.getDocumentCode().equals(key)){
				return moduleEnum.getHandleMethod();
			}
		}
		throw new IllegalArgumentException("Invalid enum Code: " + key);
	}

	public Integer getDocumentCode() {
		return documentCode;
	}

	public String getHandleMethod() {
		return handleMethod;
	}
}
